import { post } from '@/utils/ajax'

export function searchAppByPage(params) {
  return post('/code/app/info/search', params)
}

export function searchAppAll(params) {
  return post('/code/app/info/searchAll', params)
}

export function selectAppById(id) {
  return post('/code/app/info/selectById', { id })
}

export function insertApp(params) {
  return post('/code/app/info/insert', params)
}

export function updateAppById(params) {
  return post('/code/app/info/updateById', params)
}

// 根据应用id查询分组树
export function searchGroupTree(groupAppId, params) {
  return post(`/code/group/info/${groupAppId}/groupTreeList`, params)
}

export function insertGroup(params) {
  return post('/code/group/info/insert', params)
}

export function selectGroupById(id) {
  return post('/code/group/info/selectById', { id })
}

export function updateGroupById(params) {
  return post('/code/group/info/updateById', params)
}
